<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>z-index</title>
    <style>
        .container {
            width: 800px;
            margin: 0 auto;
            /* background-color: antiquewhite; */
            height: 100000px;
            position: relative;
        }

        .item {
            width: 300px;
            height: 50px;
            background-color: skyblue;
            border: 1px solid black;
        }

        .item:nth-of-type(2) {
            position: relative;
            top: -20px;
            left: 20px;
            background-color: blueviolet;
            z-index: -1;
        }

        .item:nth-of-type(4) {
            position: relative;
            top: -60px;
            left: 60px;
            background-color: aquamarine;
            z-index: -1;
        }

        .item:nth-of-type(3) {
            position: relative;
            top: -40px;
            left: 40px;
            background-color: bisque;
            z-index: -2;
        }

        .item:nth-of-type(5) {
            position: relative;
            top: -80px;
            left: 80px;
            background-color: rgb(200, 224, 64);
        }
        .item:nth-last-child(1) {
            background-color: black;
            position: relative;
            top: -100px;
            left: 100px;
            z-index: 999;
        }
    </style>
</head>
<body>

    <div class="container">

        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>

    </div>
    
</body>
</html>